import config from '../../utils/config';
import apiCreator from '../../utils/apiCreator';

export default function yieldPerformanceAPI(api) {
  return {
    // 获取顶部产品收益率统计信息
    getInfo: (query) => api.get(`${config.interfaces.type3}yieldanalysis/portYieldInfo/`, query),

    // 获取收益率柱状图--区间
    getEchartsOne: (query) => api.post(`${config.interfaces.type3}yieldanalysis/intervalYieldCmp/`, query),

    // 获取收益率柱状图--年化
    getEchartsOneYear: (query) => api.get(`${config.interfaces.type1}productJxfx/getHistogramOfProductGroupPortfolioYield`, query),

    // 获取产品组产品组合收益率柱状图--区间
    getEchartsTwo: (query) => api.post(`${config.interfaces.type3}yieldanalysis/yieldTrendCmp/`, query),

    // 获取产品组产品组合收益率柱状图-年化
    getEchartsTwoYear: (query) => api.get(`${config.interfaces.type1}productJxfx/getIntervalYieldCmp`, query),

    // 获取大类资产收益率
    getEchartsThree: (query) => api.post(`${config.interfaces.type3}yieldanalysis/majorAssetYieldTrend/`, query),

    // 获取大类资产收益率维度拆解数据
    getDimensionDisassembly: (query) => api.post(`${config.interfaces.type3}yieldanalysis/bondYiledClassifyByTerm/`, query),

    // 获取明细资产收益率
    getEchartsFour: (query) => api.post(`${config.interfaces.type3}yieldanalysis/yieldDetailTree/`, query),

    // 获取排名数据
    getRanking: (query) => api.post(`${config.interfaces.type3}yieldanalysis/intervalYieldRank/`, query),

    // 获取获取收益率明细表格 thfx/yieldanalysis/yieldDetail/
    getTableData: (query) => api.post(`${config.interfaces.type3}yieldanalysis/yieldDetail/`, query),

    // 获取顶部组合收益率及7个时间段收益率
    getPortfolioInfo: (query) => api.post(`${config.interfaces.type3}yieldanalysis/portfolioInfo/`, query),

    // 获取产品组构成
    getGroupInfo: (query) => api.post(`${config.interfaces.type3}yieldanalysis/groupInfo/`, query),
  };
}
